package dao.domain;


import java.util.Date;

/**
 * @author huangzhiyang
 * @Date 2023/9/19
 * 顾客类
 * 属性：账号，昵称，密码，级别，注册日期，金额，消费金额
 * 业务：充值，消费，还书，借阅，购买，获得会员名称
 * 特殊方法：数据库持久化（storeDB()）
 */
public class Client extends User {
    /**
     * 账号
     */
    private final String account;

    /**
     * 昵称
     */
    private String name;

    /**
     * 密码
     */
    private String password;

    /**
     * 注册日期
     */
    private Date registrationTime;

    /**
     * 金额
     */
    private double amount;

    /**
     * 消费金额
     */
    private double consumption;

    public Client(String account, String name, String password, double amount) {
        this.account = account;
        this.name = name;
        this.password = password;
        this.amount = amount;
        this.consumption = 0;

    }


    public Client(String account, String name, String password, Date registrationTime, double amount, double consumption) {
        this.account = account;
        this.name = name;
        this.password = password;
        this.registrationTime = registrationTime;
        this.amount = amount;
        this.consumption = consumption;

    }

    public String getAccount() {
        return account;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getRegistrationTime() {
        return registrationTime;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public double getConsumption() {
        return consumption;
    }

    public void setConsumption(double consumption) {
        this.consumption = consumption;
    }

    @Override
    public String toString() {

        return "账号：" + account + "\t" +
                "昵称：" + name + "\t" +
                "密码：" + password + "\t" +
                "注册日期： " + registrationTime + "\t" +
                "余额： " + amount + "\t" +
                "消费金额：" + consumption;
    }
}
